import time
import sys
import  os
import stomp
print(sys.path)
os.chdir(os.getcwd())

# dest="test_zhj"
dest="zhj_reading_audit_result_book"
def sendMq():
    pass
try:
    conn=stomp.Connection([('cloudsvc-mq-dev001-shgq.qiyi.virtual',61613)])
    print "connection"
    conn.start()
    print "start"
    conn.connect(username="qiyi",passcode="tliNoDB6",wait=True)
    print "connected"
    conn.send(body='{"a":"b","c":"d"}',destination=dest,headers={'type':'mapMessage','persistent':'true'},ack='auto')
    print "send"
    time.sleep(2)
    print "sleep"
    conn.disconnect()
    print "disconnect"
except Exception ,e:
    print("error:")
    print e